package Factory.factory;

import Factory.interfaces.Pizza;
import Factory.product.CheesePizza;
import Factory.product.ClamPizza;
import Factory.product.PepperoniPizza;
import Factory.product.VeggiePizza;

/**
 * 这是一个简单工厂
 * @Author: pengzx
 * @Description:
 * @Date: 10:01 2017/9/7
 * @Modified by: 1.0
 */
public class SimplePizzaFactory {
    public static Pizza createPizza(String type){
        Pizza pizza = null;
        if (type.equals("cheese")){
            pizza = new CheesePizza();
        }
        if(type.equals("clam")){
            pizza = new ClamPizza();
        }
        if (type.equals("pepperoni")){
            pizza = new PepperoniPizza();
        }
        if (type.equals("veggie")){
            pizza = new VeggiePizza();
        }
        return pizza;
    }
}
